<?php
        include("../../conf/mysqlconn.php");

        $dbconf = new MysqlConnector();
        $con = $dbconf->connectMySql();
        if (!$con) {
            die('连接数据库失败:' . mysql_error());
        }
        $userName = $_GET["userName"];
        $sql = "select count(*) num from User where UserID = '$userName'";
        $result = mysql_query($sql);
        $resultNum = mysql_result($result,0,"num");
        
        if(0 === $resultNum || strcmp("0",$resultNum)==0){
            //该用户名未被注册
            $response = "0";
        }else{
            //该用户名已被注册
            $response = "1";
        }
        echo $response;
        mysql_close($con);
?>